<cfcomponent displayname="babylon" output="false" hint="I live to babylon.">


	<cffunction name="getBabylonServer" output="false" returntype="any">
			<cfscript>
				var loader = "";
				var babylonServ  = structNew();
				var paths = arrayNew(1);
			  var ws = "";
				var locale="";
					/*
					This points to the jar we want to load.
					Could also load a directory of .class files
					*/
				paths[1] = getDirectoryFromPath(getCurrentTemplatePath()) & "babylon.jar";
					//create the loader
				loader = createObject("component", "javaloader.JavaLoader").init(paths);
					//at this stage we only have access to the class, but we don't have an instance
				serverArgs = arrayNew(1);
				serverArgs[1] = "-nographics";
				babylonServ = loader.create("babylonServer");
				babylonServ.init(serverArgs);
				return babylonServ;
			</cfscript>
	</cffunction>

	<cffunction name="stopBabylonServer" output="false" returntype="any">
		<cfargument name="babylonServer">
			<cfscript>
				var loader = "";
				var babylonServ  = structNew();
				var paths = arrayNew(1);
			  var ws = "";
				var locale="";
					/*
					This points to the jar we want to load.
					Could also load a directory of .class files
					*/
				paths[1] = getDirectoryFromPath(getCurrentTemplatePath()) & "babylon.jar";
					//create the loader
				loader = createObject("component", "javaloader.JavaLoader").init(paths);
					//at this stage we only have access to the class, but we don't have an instance
				serverArgs = arrayNew(1);
				serverArgs[1] = "-nographics";
				babylonServ = loader.create("babylonServerShutdown");
				babylonServ.init(arguments.babylonServer);
			</cfscript>
	</cffunction>

	
</cfcomponent>